<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>numberbox</title>
<link rel="stylesheet" type="text/css" href="css/easyui.css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" type="text/css" href="css/SyntaxHighlighter.css" />

<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
</head>
<body style="text-align:left">
<div style="padding:10px">

<h3>NumberBox</h3>
<p>Extend from $.fn.validatebox.defaults. Override defaults with $.fn.numberbox.defaults.</p>
<img src="images/numberbox.png">

<h4>Dependencies</h4>
<ul>
	<li>validatebox</li>
</ul>

<h4>Usage</h4>
<div class="dp-highlighter"><div class="bar"><div class="tools"></div></div><ol start="1" class="dp-xml"><li class="alt"><span><span class="tag">&lt;</span><span class="tag-name">input</span><span>&nbsp;</span><span class="attribute">type</span><span>=</span><span class="attribute-value">"text"</span><span>&nbsp;</span><span class="attribute">id</span><span>=</span><span class="attribute-value">"nn"</span><span class="tag">&gt;</span><span class="tag">&lt;/</span><span class="tag-name">input</span><span class="tag">&gt;</span><span>&nbsp;&nbsp;</span></span></li></ol></div><textarea class="html" name="code-numberbox" style="display: none;">	&lt;input type="text" id="nn"&gt;&lt;/input&gt;
</textarea>
<div class="dp-highlighter"><div class="bar"><div class="tools"></div></div><ol start="1" class="dp-c"><li class="alt"><span><span>$(</span><span class="string">'#nn'</span><span>).numberbox({&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;min:0,&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;precision:2&nbsp;&nbsp;</span></li><li class=""><span>});&nbsp;&nbsp;</span></li></ol></div><textarea class="js" name="code-numberbox" style="display: none;">	$('#nn').numberbox({
		min:0,
		precision:2
	});
</textarea>

<h4>Properties</h4>
<p>The properties extend from validatebox, below is the added properties for numberbox.</p>
<table class="doc-table">
<tbody><tr>
<th><strong>Name</strong></th>
<th><strong>Type</strong></th>
<th><strong>Description</strong></th>
<th><strong>Default</strong></th>
</tr>
<tr>
<td>disabled</td>

<td>boolean</td>
<td>Defines if to disable the field.</td>
<td>false</td>
</tr>
<tr>
<td>value</td>
<td>number</td>
<td>The default value.</td>
<td></td>
</tr>
<tr>
<td>min</td>
<td>number</td>
<td>The minimum allowed value.</td>
<td>null</td>
</tr>

<tr>
<td>max</td>
<td>number</td>
<td>The maximum allowed value.</td>
<td>null</td>
</tr>
<tr>
<td>precision</td>
<td>number</td>
<td>The maximum precision to display after the decimal separator.</td>

<td>0</td>
</tr>
<tr>
<td>decimalSeparator</td>
<td>string</td>
<td>The decimal character separates the integer and decimal parts of a number.</td>
<td>.</td>
</tr>
<tr>
<td>groupSeparator</td>
<td>string</td>
<td>The character that separates integer groups to show thousands and millions.</td>
<td></td>
</tr>
<tr>
<td>prefix</td>
<td>string</td>
<td>The prefix string.</td>
<td></td>
</tr>
<tr>
<td>suffix</td>
<td>string</td>
<td>The suffix string.</td>
<td></td>
</tr>
<tr>
<td>formatter</td>
<td>function(value)</td>
<td>
A function to format the numberbox value.
Return string value that will display on box.
</td>
<td></td>
</tr>
<tr><td>parser</td>
<td>function(s)</td>
<td>
A function to parse a string.
Return numberbox value.
</td>
<td></td>
</tr>
</tbody></table>

<h4>Events</h4>
<table class="doc-table">

<tbody><tr>
<th><strong>Name</strong></th>
<th><strong>Parameters</strong></th>
<th><strong>Description</strong></th>
</tr>
<tr>
<td>onChange</td>
<td>newValue,oldValue</td>
<td>Fires when the field value is changed.</td>
</tr>
</tbody></table>

<h4>Methods</h4>
<p>The methods extend from validatebox, below is the added or overridden methods for numberbox.</p>
<table class="doc-table">
<tbody><tr>
<th><strong>Name</strong></th>

<th><strong>Parameter</strong></th>
<th><strong>Description</strong></th>
</tr>
<tr>
<td>options</td>
<td>none</td>
<td>Return the numberbox options.</td>
</tr>
<tr>
<td>destroy</td>
<td>none</td>
<td>Destroy the numberbox object.</td>
</tr>
<tr>
<td>disable</td>
<td>none</td>
<td>Disable the field.</td>
</tr>
<tr>
<td>enable</td>
<td>none</td>

<td>Enable the field.</td>
</tr>
<tr>
<td>fix</td>
<td>none</td>
<td>Fix the value to valid value.</td>
</tr>
<tr>
<td>setValue</td>
<td>value</td>
<td>Set numberbox value.</td>
</tr>
<tr>
<td>getValue</td>
<td>none</td>
<td>Get numberbox value.</td>
</tr>
<tr>
<td>clear</td>
<td>none</td>
<td>Clear numberbox value.</td>
</tr>
</tbody></table>

</div>	
</body>
</html>